<template>
	<BasicContainer :navigators="['一级菜单', '二级菜单', '三级菜单']" :title="'同步记录管理'">
		<div style="width:1300px;">
			<a-form layout="inline">
				<a-row style="margin-bottom:15px">
					<a-col :span="6">
						<a-form-item label="开始时间">
							<a-date-picker v-model="startTime" :format="dateFormat" @change="onChange" />
						</a-form-item>
					</a-col>
					<a-col :span="6">
						<a-form-item label="同步类型">
							<a-select style="width: 180px" placeholder="请选择">
								<a-select-option value="0">
									ITPM新增项目
								</a-select-option>
								<a-select-option value="1">
									TAPD新增需求
								</a-select-option>
								<a-select-option value="2">
									ITPM新增需求
								</a-select-option>
								<a-select-option value="3">
									ITPM变更需求
								</a-select-option>
								<a-select-option value="4">
									TAPD需求进度
								</a-select-option>
							</a-select>
						</a-form-item>
					</a-col>
				</a-row>

				<a-row>
					<a-col :span="8">
						<a-button type="primary" style="margin-left:70px">
							<a-icon type="search" />搜索
						</a-button>
						<a-button style="margin-left: 10px;">
							<a-icon type="reload" />重置
						</a-button>
					</a-col>
				</a-row>
			</a-form>
		</div>
		<a-table :columns="columns" style="margin-top: 16px" :locale="locale" :dataSource="tableData"
			:pagination="tablePagination" :rowKey="(record, index) => index">
			<template slot="itpmProjectName" slot-scope="text,record">
				<a-tooltip placement="top" v-if="record.itpmProjectName">
					<template slot="title">
						<p>{{ record.itpmProjectName }}</p>
					</template>
					<span style="cursor:default">{{ record.itpmProjectName }}</span>
				</a-tooltip>
				<span v-else-if="!record.itpmProjectName">—</span>
			</template>
			<template slot="tapdProjectName" slot-scope="text,record">
				<a-tooltip placement="top" v-if="record.tapdProjectName">
					<template slot="title">
						<p>{{ record.tapdProjectName }}</p>
					</template>
					<span style="cursor:default">{{ record.tapdProjectName }}</span>
				</a-tooltip>
				<span v-else-if="!record.tapdProjectName">—</span>
			</template>
		</a-table>
	</BasicContainer>
</template>
<script>
import EmptyWrap from '@/components/emptyWrap';
import moment from 'moment';
export default {
	data() {
		return {
			startTime: '',//开始时间默认值
			dateFormat: 'YYYY/MM/DD HH:mm:ss',//设置开始时间的时间格式
			locale: {//默认文案设置，目前包括排序、过滤、空数据文案
				emptyText: <EmptyWrap text="暂无相关数据" type="file-search"></EmptyWrap>
			},
			tablePagination: {//主页表格的分页器
				showQuickJumper: true,//是否可以快速跳转至某页
				showSizeChanger: true,//是否可以改变 pageSize
			},
			columns: [
				{
					title: "ITPM项目名称",
					dataIndex: "itpmProjectName",
					scopedSlots: {customRender:'itpmProjectName'},
				},
				{
					title: "ITPM项目编码",
					dataIndex: "itpmProjectCoding",
					customRender:(text,record)=>{
						return record.itpmProjectCoding?record.itpmProjectCoding:'—';
					},
				},
				{
					title: "TAPD项目名称",
					dataIndex: "tapdProjectName",
					scopedSlots: {customRender:'tapdProjectName'},
				},
				{
					title: "TAPD项目ID",
					dataIndex: "tapdProjectId",
					customRender:(text,record)=>{
						return record.tapdProjectId?record.tapdProjectId:'—';
					},
				},
				{
					title: "同步类型",
					dataIndex: "syncType",
					customRender:(text,record)=>{
						return record.syncType?record.syncType:'—';
					},
				},
				{
					title: "触发类型",
					dataIndex: "triggerType",
					customRender:(text,record)=>{
						return record.triggerType?record.triggerType:'—';
					},
				},
				{
					title: "开始时间",
					dataIndex: "startTime",
					customRender:(text,record)=>{
						return record.startTime?record.startTime:'—';
					},
				},
				{
					title: "结束时间",
					dataIndex: "endTime",
					customRender:(text,record)=>{
						return record.endTime?record.endTime:'—';
					},
				},
				{
					title: "同步情况",
					dataIndex: "syncCondition",
					customRender:(text,record)=>{
						return record.syncCondition?record.syncCondition:'—';
					},
				},
			],
			tableData: [
				{
					itpmProjectName: "项目1",
					itpmProjectCoding: "741",
					tapdProjectName: "项目1",
					tapdProjectId: "789",
					syncType: "差类型",
					triggerType: "触发类型1",
					startTime: "2021",
					endTime: "2022",
					syncCondition: "良好",
				},
				{
					itpmProjectName: "项目2",
					itpmProjectCoding: "741",
					tapdProjectName: "项目1",
					tapdProjectId: "789",
					syncType: "差类型",
					triggerType: "触发类型1",
					startTime: "2021",
					endTime: "2022",
					syncCondition: "良好",
				},
				{
					itpmProjectName: "项目3",
					itpmProjectCoding: "741",
					tapdProjectName: "项目1",
					tapdProjectId: "789",
					syncType: "差类型",
					triggerType: "触发类型1",
					startTime: "2021",
					endTime: "2022",
					syncCondition: "良好",
				},
				{
					itpmProjectName: "项目4",
					itpmProjectCoding: "741",
					tapdProjectName: "项目1",
					tapdProjectId: "789",
					syncType: "差类型",
					triggerType: "触发类型1",
					startTime: "2021",
					endTime: "2022",
					syncCondition: "良好",
				},
				{
					itpmProjectName: "项目5",
					itpmProjectCoding: "741",
					tapdProjectName: "项目1",
					tapdProjectId: "789",
					syncType: "差类型",
					triggerType: "触发类型1",
					startTime: "2021",
					endTime: "2022",
					syncCondition: "良好",
				},
				{
					itpmProjectName: "项目6",
					itpmProjectCoding: "741",
					tapdProjectName: "项目1",
					tapdProjectId: "789",
					syncType: "差类型",
					triggerType: "触发类型1",
					startTime: "2021",
					endTime: "2022",
					syncCondition: "良好",
				},
				{
					itpmProjectName: "项目7",
					itpmProjectCoding: "741",
					tapdProjectName: "项目1",
					tapdProjectId: "789",
					syncType: "差类型",
					triggerType: "触发类型1",
					startTime: "2021",
					endTime: "2022",
					syncCondition: "良好",
				},
				{
					itpmProjectName: "项目8",
					itpmProjectCoding: "741",
					tapdProjectName: "项目1",
					tapdProjectId: "789",
					syncType: "差类型",
					triggerType: "触发类型1",
					startTime: "2021",
					endTime: "2022",
					syncCondition: "良好",
				},
				{
					itpmProjectName: "项目9",
					itpmProjectCoding: "741",
					tapdProjectName: "项目1",
					tapdProjectId: "789",
					syncType: "差类型",
					triggerType: "触发类型1",
					startTime: "2021",
					endTime: "2022",
					syncCondition: "良好",
				},
				{
					itpmProjectName: "项目10",
					itpmProjectCoding: "741",
					tapdProjectName: "项目1",
					tapdProjectId: "789",
					syncType: "差类型",
					triggerType: "触发类型1",
					startTime: "2021",
					endTime: "2022",
					syncCondition: "良好",
				},
				{
					itpmProjectName: "项目11",
					itpmProjectCoding: "741",
					tapdProjectName: "项目1",
					tapdProjectId: "789",
					syncType: "差类型",
					triggerType: "触发类型1",
					startTime: "2021",
					endTime: "2022",
					syncCondition: "良好",
				},
			],
		};
	},
	created() {
	},
	computed: {},
	methods: {
		moment,
		onChange(date) {//监听开始时间
			console.log(date);
		}
	},
}
</script>